﻿using EAPWrapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EAPWrapperTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            string reqestBody = @"<?xml version=""1.0""?>
<Request>
<Header Culture=""CN"" UserID=""Hotel.WSUser"" RequestType=""Hotel.Product.IsBookableService.RscWebServiceBookChecker"" AsyncRequest=""false"" />
<RscWebServiceRequestEntity xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<HotelOrderContentEntity xsi:type=""RscHotelOrderContentRequestEntity"">
<Arrival>2012-03-01T00:00:00</Arrival>
<BalanceType>PP</BalanceType>
<ClientComeFrom>1</ClientComeFrom>
<ClientName>xiaoxiao</ClientName>
<CorpUserID />
<CustomerType>F</CustomerType>
<Departure>2012-03-05T00:00:00</Departure>
<EarlyArrivalTime>2012-03-01T12:00:00</EarlyArrivalTime>
<FormatRemark />
<HoldDeadLine>9999</HoldDeadLine>
<IsChangeClientData>false</IsChangeClientData>
<IsConfirmGuarantee>false</IsConfirmGuarantee>
<IsInRange />
<IsNeedUseFGToGetLastCancel>false</IsNeedUseFGToGetLastCancel>
<IsNewProCanUse>true</IsNewProCanUse>
<IsPreliminary>false</IsPreliminary>
<Language>CN</Language>
<LateArrivalTime>2012-03-01T14:00:00</LateArrivalTime>
<MaxRoomCount>8</MaxRoomCount>
<MaxValidRoom>0</MaxValidRoom>
<MinState>1</MinState>
<OrderID>0</OrderID>
<Ori_OrderID>0</Ori_OrderID>
<PaymentType />
<Persons>1</Persons>
<PrepayReserveType />
<priceChangeFlag>F</priceChangeFlag>
<PromoteEndDate>0001-01-01T00:00:00</PromoteEndDate>
<PromoteStartDate>0001-01-01T00:00:00</PromoteStartDate>
<PromoteType>0</PromoteType>
<Quantity>1</Quantity>
<RealRoomNumber>0</RealRoomNumber>
<Room>187698</Room>
<ServerFrom />
<UID>123</UID>
<UseFG />
<Userlimited>9999</Userlimited>
<ValidRoom>0</ValidRoom>
</HotelOrderContentEntity>
<ContactEntity xsi:type=""RscHotelOrderContactRequestEntity"">
<ContractName>xiaoxiao</ContractName>
<ContractTel>12345678</ContractTel>
<ConfirmType>TEL</ConfirmType>
<ContractEmail />
<MobilePhone />
<ForeignMobile />
<ContractFax />
</ContactEntity>
<InvoiceEntity xsi:type=""RscHotelOrderInvoiceRequestEntity"">
<AskForInvoice>0</AskForInvoice>
<PostCode />
<RevAddr />
<RevPerName />
</InvoiceEntity>
<OperationType>NewHotelOrder</OperationType>
<CreditCardEntity xsi:type=""RscCreditCardRequestEntity"">
<CardInfoID>100</CardInfoID>
<CreditCardType>1</CreditCardType>
</CreditCardEntity>
</RscWebServiceRequestEntity>
</Request>";
            string reqestBody2 = @"<?xml version=""1.0""?>
<Request>
<Header Culture=""CN"" UserID=""Hotel.WSUser"" RequestType=""Hotel.Product.IsBookableService.RscWebServiceBookChecker"" AsyncRequest=""false"" />
<RscWebServiceRequestEntity xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<HotelOrderContentEntity xsi:type=""RscHotelOrderContentRequestEntity"">
<Arrival>2012-03-01T00:00:00</Arrival>
<BalanceType>PP</BalanceType>
<ClientComeFrom>1</ClientComeFrom>
<ClientName>xiaoxiao</ClientName>
<CorpUserID />
<CustomerType>F</CustomerType>
<Departure>2012-03-05T00:00:00</Departure>
<EarlyArrivalTime>2012-03-01T12:00:00</EarlyArrivalTime>
<FormatRemark />
<HoldDeadLine>9999</HoldDeadLine>
<IsChangeClientData>false</IsChangeClientData>
<IsConfirmGuarantee>false</IsConfirmGuarantee>
<IsInRange />
<IsNeedUseFGToGetLastCancel>false</IsNeedUseFGToGetLastCancel>
<IsNewProCanUse>true</IsNewProCanUse>
<IsPreliminary>false</IsPreliminary>
<Language>CN</Language>
<LateArrivalTime>2012-03-01T14:00:00</LateArrivalTime>
<MaxRoomCount>8</MaxRoomCount>
<MaxValidRoom>0</MaxValidRoom>
<MinState>1</MinState>
<OrderID>0</OrderID>
<Ori_OrderID>0</Ori_OrderID>
<PaymentType />
<Persons>1</Persons>
<PrepayReserveType />
<priceChangeFlag>F</priceChangeFlag>
<PromoteEndDate>0001-01-01T00:00:00</PromoteEndDate>
<PromoteStartDate>0001-01-01T00:00:00</PromoteStartDate>
<PromoteType>0</PromoteType>
<Quantity>1</Quantity>
<RealRoomNumber>0</RealRoomNumber>
<Room>187698</Room>
<ServerFrom />
<UID>123</UID>
<UseFG />
<Userlimited>9999</Userlimited>
<ValidRoom>0</ValidRoom>
</HotelOrderContentEntity>
<ContactEntity xsi:type=""RscHotelOrderContactRequestEntity"">
<ContractName>xiaoxiao</ContractName>
<ContractTel>12345678</ContractTel>
<ConfirmType>TEL</ConfirmType>
<ContractEmail />
<MobilePhone />
<ForeignMobile />
<ContractFax />
</ContactEntity>
<InvoiceEntity xsi:type=""RscHotelOrderInvoiceRequestEntity"">
<AskForInvoice>0</AskForInvoice>
<PostCode />
<RevAddr />
<RevPerName />
</InvoiceEntity>
<OperationType>NewHotelOrder</OperationType>
<CreditCardEntity xsi:type=""RscCreditCardRequestEntity"">
<CardInfoID>1000</CardInfoID>
<CreditCardType>1</CreditCardType>
</CreditCardEntity>
</RscWebServiceRequestEntity>
</Request>";
            var task = TAPWSAgent.RequestAsync(reqestBody);
            for (int i = 0; i < 10; i++)
            {
                task = TAPWSAgent.RequestAsync(reqestBody); 
            }
            string result = task.Result;
            Console.WriteLine(result);
            Console.ReadLine();
        }
    }
}
